package com.appheader.webfragmentviewpagertest.viewholder;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.appheader.webfragmentviewpagertest.R;
import com.appheader.webfragmentviewpagertest.listener.OnHorizontalRecyclerViewListener;
import com.appheader.webfragmentviewpagertest.listener.OnRecyclerViewItemClickListener;

/**
 * Created by zhep on 2016/9/29.
 */
public class VerticalViewHolder extends RecyclerView.ViewHolder implements OnRecyclerViewItemClickListener{
    public RecyclerView recyclerView;
    private OnHorizontalRecyclerViewListener listener;

    public VerticalViewHolder(View itemView, OnHorizontalRecyclerViewListener listener) {
        super(itemView);
        recyclerView = (RecyclerView) itemView.findViewById(R.id.vertical_recycler);
        this.listener = listener;
    }


    @Override
    public void onItemClick(View v, int vPosition) {
        if (listener!=null){
            listener.onItemPosition(v,getPosition(),getPosition());
        }
    }
}
